package com.tsd.common.controller;

import com.tsd.core.vo.ErrorCode;
import com.tsd.core.vo.HttpResult;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * Shiro权限
 *
 * @author
 */
@Controller
@Scope("prototype")
@RestController
@RequestMapping("/auth")
public class AuthController extends BaseController {

    @GetMapping("/index")
    public Object index() {
        return HttpResult.fail(ErrorCode.CODE_SUCCESS, "成功");
    }

    @GetMapping("/401")
    public Object page401() {
        return HttpResult.fail(ErrorCode.CODE_NO_LOGINNED, "请登录");
    }

    @GetMapping("/403")
    public Object page403() {
        return HttpResult.fail(ErrorCode.CODE_PROC_ERROR, "无操作权限");
    }

    @GetMapping("/404")
    public Object page404() {
        return "页面不存在";
    }
}
